package com.atguigu.daijia.customer.client;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.model.entity.customer.CustomerInfo;
import com.atguigu.daijia.model.form.customer.UpdateWxPhoneForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "service-customer")
public interface CustomerInfoFeignClient {  //注意这里是service-customer服务的feign客户端，下面的方法一定是和service-customer服务的接口一致

    /**
     * 微信小程序登录接口
     */
    @GetMapping("/customer/info/login/{code}")  //把接口路径写完整
    Result<Long> login(@PathVariable String code);

    /**
     * 根据customerId来获取用户信息
     */
    @GetMapping("/customer/info/getCustomerInfo/{customerId}")
    Result<CustomerInfo> getCustomerInfo(@PathVariable Long customerId);

    /**
     * 获取并保存用户留在微信的手机号
     * @param updateWxPhoneForm
     * @return
     */
    @PostMapping("/customer/info/updateWxPhoneNumber")
    Result<Boolean> updateWxPhoneNumber(@RequestBody UpdateWxPhoneForm updateWxPhoneForm);
}